<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<!--      <el-form-item label="纬度" prop="latitude">-->
<!--        <el-input-->
<!--          v-model="queryParams.latitude"-->
<!--          placeholder="请输入纬度"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="经度" prop="longitude">-->
<!--        <el-input-->
<!--          v-model="queryParams.longitude"-->
<!--          placeholder="请输入经度"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
      <el-form-item label="客户名称" prop="clientName">
        <el-input
          v-model="queryParams.clientName"
          placeholder="请输入客户名称"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
<!--      <el-form-item label="手机号" prop="phone">-->
<!--        <el-input-->
<!--          v-model="queryParams.phone"-->
<!--          placeholder="请输入手机号"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
      <el-form-item label="房源标题" prop="title">
        <el-input
          v-model="queryParams.title"
          placeholder="请输入房源标题"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
<!--      <el-form-item label="放盘价" prop="priceYuan">-->
<!--        <el-input-->
<!--          v-model="queryParams.priceYuan"-->
<!--          placeholder="请输入放盘价"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="建筑面积" prop="builtUpAreaSquareCentimeter">-->
<!--        <el-input-->
<!--          v-model="queryParams.builtUpAreaSquareCentimeter"-->
<!--          placeholder="请输入建筑面积"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="上传时间" prop="uploadTime">-->
<!--        <el-date-picker clearable-->
<!--          v-model="queryParams.uploadTime"-->
<!--          type="date"-->
<!--          value-format="yyyy-MM-dd"-->
<!--          placeholder="请选择上传时间">-->
<!--        </el-date-picker>-->
<!--      </el-form-item>-->
<!--      <el-form-item label="省" prop="province">-->
<!--        <el-input-->
<!--          v-model="queryParams.province"-->
<!--          placeholder="请输入省"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="城市" prop="city">-->
<!--        <el-input-->
<!--          v-model="queryParams.city"-->
<!--          placeholder="请输入城市"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="区" prop="district">-->
<!--        <el-input-->
<!--          v-model="queryParams.district"-->
<!--          placeholder="请输入区"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
<!--      <el-form-item label="地址" prop="address">-->
<!--        <el-input-->
<!--          v-model="queryParams.address"-->
<!--          placeholder="请输入地址"-->
<!--          clearable-->
<!--          @keyup.enter.native="handleQuery"-->
<!--        />-->
<!--      </el-form-item>-->
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['yipaiju:discount_house:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['yipaiju:discount_house:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['yipaiju:discount_house:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['yipaiju:discount_house:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table v-loading="loading" :data="discount_houseList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center" />
<!--      <el-table-column label="id" align="center" prop="id" />-->
<!--      <el-table-column label="纬度" align="center" prop="latitude" />-->
<!--      <el-table-column label="经度" align="center" prop="longitude" />-->
<!--      <el-table-column label="position" align="center" prop="position" />-->
      <el-table-column label="客户名称" align="center" prop="clientName" />
      <el-table-column label="手机号" align="center" prop="phone" />
<!--      <el-table-column label="注册时间" align="center" prop="registerTime" width="180">-->
<!--        <template slot-scope="scope">-->
<!--          <span>{{ parseTime(scope.row.registerTime, '{y}-{m}-{d}') }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
<!--      <el-table-column label="only_house" align="center" prop="onlyHouse" />-->
<!--      <el-table-column label="拥有类型" align="center" prop="owningType" />-->
<!--      <el-table-column label="degree" align="center" prop="degree" />-->
<!--      <el-table-column label="拥有学位" align="center" prop="havingDegree" />-->
<!--      <el-table-column label="stage" align="center" prop="stage">-->
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.fo_discount_house_stage" :value="scope.row.stage"/>-->
<!--        </template>-->
<!--      </el-table-column>-->
<!--      <el-table-column label="折扣" align="center" prop="discountRate" />-->
<!--      <el-table-column label="状态" align="center" prop="status">-->
<!--        <template slot-scope="scope">-->
<!--          <dict-tag :options="dict.type.fo_discount_house_status" :value="scope.row.status"/>-->
<!--        </template>-->
<!--      </el-table-column>-->
      <el-table-column label="房源标题" align="center" prop="title" :show-overflow-tooltip='true'/>
<!--      <el-table-column label="浏览次数" align="center" prop="browseCount" />-->
      <el-table-column label="放盘价" align="center" prop="priceYuan" />
      <el-table-column label="建筑面积" align="center" prop="builtUpAreaSquareCentimeter" />
<!--      <el-table-column label="上传时间" align="center" prop="uploadTime" width="180">-->
<!--        <template slot-scope="scope">-->
<!--          <span>{{ parseTime(scope.row.uploadTime, '{y}-{m}-{d}') }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
<!--      <el-table-column label="residential_quarter_name" align="center" prop="residentialQuarterName" />-->
      <el-table-column label="省" align="center" prop="province" />
      <el-table-column label="城市" align="center" prop="city" />
<!--      <el-table-column label="区" align="center" prop="district" />-->
      <el-table-column label="地址" align="center" prop="address" :show-overflow-tooltip='true'/>
<!--      <el-table-column label="朝向" align="center" prop="orientation" />-->
<!--      <el-table-column label="房源楼层" align="center" prop="houseLevel" />-->
<!--      <el-table-column label="总楼层" align="center" prop="houseTotalLevel" />-->
<!--      <el-table-column label="电梯" align="center" prop="elevator" />-->
<!--      <el-table-column label="装修" align="center" prop="decoration" />-->
<!--      <el-table-column label="交通" align="center" prop="traffic" />-->
<!--      <el-table-column label="教育" align="center" prop="education" />-->
<!--      <el-table-column label="医院" align="center" prop="hospital" />-->
<!--      <el-table-column label="便利店" align="center" prop="amenity" />-->
<!--      <el-table-column label="位置" align="center" prop="location" />-->
<!--      <el-table-column label="单元号" align="center" prop="unitNo" />-->
<!--      <el-table-column label="使用面积" align="center" prop="insideAreaSquareCentimeter" />-->
<!--      <el-table-column label="房龄" align="center" prop="houseAge" />-->
<!--      <el-table-column label="房主" align="center" prop="houseUser" />-->
<!--      <el-table-column label="租赁" align="center" prop="remainingLease" width="180">-->
<!--        <template slot-scope="scope">-->
<!--          <span>{{ parseTime(scope.row.remainingLease, '{y}-{m}-{d}') }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
<!--      <el-table-column label="租金" align="center" prop="rentYuan" />-->
      <el-table-column label="单价" align="center" prop="unitPriceYuan" />
<!--      <el-table-column label="viewing_call" align="center" prop="viewingCall" />-->
<!--      <el-table-column label="抵押1" align="center" prop="mortgage1" />-->
<!--      <el-table-column label="抵押2" align="center" prop="mortgage2" />-->
<!--      <el-table-column label="抵押1价格" align="center" prop="mortgage1PriceYuan" />-->
<!--      <el-table-column label="抵押2价格" align="center" prop="mortgage2PriceYuan" />-->
<!--      <el-table-column label="查封" align="center" prop="seizure" />-->
<!--      <el-table-column label="查封人1" align="center" prop="confiscator1" />-->
<!--      <el-table-column label="查封人2" align="center" prop="confiscator2" />-->
<!--      <el-table-column label="查封金额1" align="center" prop="seizureAmount1" />-->
<!--      <el-table-column label="查封金额2" align="center" prop="seizureAmount2" />-->
      <el-table-column label="评估价" align="center" prop="estimatePriceYuan" />
      <el-table-column label="市场价" align="center" prop="marketPriceYuan" />
      <el-table-column label="意向价" align="center" prop="intentionPriceYuan" />
<!--      <el-table-column label="具体要求" align="center" prop="specificRequirement" />-->
<!--      <el-table-column label="推荐人" align="center" prop="recommender" />-->
<!--      <el-table-column label="bedroom" align="center" prop="bedroom" />-->
<!--      <el-table-column label="客厅" align="center" prop="livingroom" />-->
<!--      <el-table-column label="厕所" align="center" prop="toilet" />-->
<!--      <el-table-column label="厨房" align="center" prop="kitchen" />-->
<!--      <el-table-column label="阳台" align="center" prop="balcony" />-->
<!--      <el-table-column label="merchant" align="center" prop="merchant" />-->
<!--      <el-table-column label="tagsstr" align="center" prop="tagsstr" />-->
<!--      <el-table-column label="banner" align="center" prop="banner" />-->
<!--      <el-table-column label="卧室" align="center" prop="deleteTime" width="180">-->
<!--        <template slot-scope="scope">-->
<!--          <span>{{ parseTime(scope.row.deleteTime, '{y}-{m}-{d}') }}</span>-->
<!--        </template>-->
<!--      </el-table-column>-->
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-edit"
            @click="handleUpdate(scope.row)"
            v-hasPermi="['yipaiju:discount_house:edit']"
          >修改</el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="handleDelete(scope.row)"
            v-hasPermi="['yipaiju:discount_house:remove']"
          >删除</el-button>
        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改折扣房源对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">

<!--        <el-row>-->
<!--          <el-col :span="12">-->
<!--            <el-form-item label="纬度" prop="latitude">-->
<!--              <el-input v-model="form.latitude" placeholder="请输入纬度" />-->
<!--            </el-form-item>-->
<!--          </el-col>-->
<!--          <el-col :span="12">-->
<!--            <el-form-item label="经度" prop="longitude">-->
<!--              <el-input v-model="form.longitude" placeholder="请输入经度" />-->
<!--            </el-form-item>-->
<!--          </el-col>-->
<!--        </el-row>-->

        <el-row>
          <el-col :span="12">
            <el-form-item label="客户名称" prop="clientName">
              <el-input v-model="form.clientName" placeholder="请输入客户名称" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="手机号" prop="phone">
              <el-input v-model="form.phone" placeholder="请输入手机号" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="注册时间" prop="registerTime">
              <el-date-picker clearable
                              v-model="form.registerTime"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="请选择注册时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="唯一住户" prop="onlyHouse">
              <el-input v-model="form.onlyHouse" placeholder="" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="degree" prop="degree">
              <el-input v-model="form.degree" placeholder="请输入degree" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="拥有学位" prop="havingDegree">
              <el-input v-model="form.havingDegree" placeholder="请输入拥有学位" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="阶段" prop="stage">
              <el-select v-model="form.stage" placeholder="">
                <el-option
                  v-for="dict in dict.type.fo_discount_house_stage"
                  :key="dict.value"
                  :label="dict.label"
                  :value="parseInt(dict.value)"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="折扣" prop="discountRate">
              <el-input v-model="form.discountRate" placeholder="请输入折扣" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="房源标题" prop="title">
              <el-input v-model="form.title" placeholder="请输入房源标题" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="状态" prop="status">
              <el-select v-model="form.status" placeholder="请选择状态">
                <el-option
                  v-for="dict in dict.type.fo_discount_house_status"
                  :key="dict.value"
                  :label="dict.label"
                  :value="parseInt(dict.value)"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="浏览次数" prop="browseCount">
              <el-input v-model="form.browseCount" placeholder="请输入浏览次数" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="放盘价" prop="priceYuan">
              <el-input v-model="form.priceYuan" placeholder="请输入放盘价" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="建筑面积" prop="builtUpAreaSquareCentimeter">
              <el-input v-model="form.builtUpAreaSquareCentimeter" placeholder="请输入建筑面积" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="上传时间" prop="uploadTime">
              <el-date-picker clearable
                              v-model="form.uploadTime"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="请选择上传时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="住宅名称" prop="residentialQuarterName">
              <el-input v-model="form.residentialQuarterName" placeholder="请输入住宅名称" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="省" prop="province">
              <el-input v-model="form.province" placeholder="请输入省" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="城市" prop="city">
              <el-input v-model="form.city" placeholder="请输入城市" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="区" prop="district">
              <el-input v-model="form.district" placeholder="请输入区" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="地址" prop="address">
              <el-input v-model="form.address" placeholder="请输入地址" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="朝向" prop="orientation">
              <el-input v-model="form.orientation" placeholder="请输入朝向" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="房源楼层" prop="houseLevel">
              <el-input v-model="form.houseLevel" placeholder="请输入房源楼层" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="总楼层" prop="houseTotalLevel">
              <el-input v-model="form.houseTotalLevel" placeholder="请输入总楼层" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="电梯" prop="elevator">
              <el-input v-model="form.elevator" placeholder="请输入电梯" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="装修" prop="decoration">
              <el-input v-model="form.decoration" placeholder="请输入装修" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="交通" prop="traffic">
              <el-input v-model="form.traffic" type="textarea" placeholder="请输入内容" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="教育" prop="education">
              <el-input v-model="form.education" type="textarea" placeholder="请输入内容" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="医院" prop="hospital">
              <el-input v-model="form.hospital" type="textarea" placeholder="请输入内容" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="便利店" prop="amenity">
              <el-input v-model="form.amenity" type="textarea" placeholder="请输入内容" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="位置" prop="location">
              <el-input v-model="form.location" placeholder="请输入位置" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="单元号" prop="unitNo">
              <el-input v-model="form.unitNo" placeholder="请输入单元号" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="使用面积" prop="insideAreaSquareCentimeter">
              <el-input v-model="form.insideAreaSquareCentimeter" placeholder="请输入使用面积" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="房龄" prop="houseAge">
              <el-input v-model="form.houseAge" placeholder="请输入房龄" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="房主" prop="houseUser">
              <el-input v-model="form.houseUser" placeholder="请输入房主" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="租赁" prop="remainingLease">
              <el-date-picker clearable
                              v-model="form.remainingLease"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="请选择租赁">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="租金" prop="rentYuan">
              <el-input v-model="form.rentYuan" placeholder="请输入租金" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="单价" prop="unitPriceYuan">
              <el-input v-model="form.unitPriceYuan" placeholder="请输入单价" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="抵押" prop="viewingCall">
              <el-input v-model="form.viewingCall" placeholder="" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="抵押1" prop="mortgage1">
              <el-input v-model="form.mortgage1" placeholder="请输入抵押1" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="抵押2" prop="mortgage2">
              <el-input v-model="form.mortgage2" placeholder="请输入抵押2" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="抵押1价格" prop="mortgage1PriceYuan">
              <el-input v-model="form.mortgage1PriceYuan" placeholder="请输入抵押1价格" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="抵押2价格" prop="mortgage2PriceYuan">
              <el-input v-model="form.mortgage2PriceYuan" placeholder="请输入抵押2价格" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="查封" prop="seizure">
              <el-input v-model="form.seizure" placeholder="请输入查封" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="查封人1" prop="confiscator1">
              <el-input v-model="form.confiscator1" placeholder="请输入查封人1" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="查封人2" prop="confiscator2">
              <el-input v-model="form.confiscator2" placeholder="请输入查封人2" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="查封金额1" prop="seizureAmount1">
              <el-input v-model="form.seizureAmount1" placeholder="请输入查封金额1" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="查封金额2" prop="seizureAmount2">
              <el-input v-model="form.seizureAmount2" placeholder="请输入查封金额2" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="评估价" prop="estimatePriceYuan">
              <el-input v-model="form.estimatePriceYuan" placeholder="请输入评估价" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="市场价" prop="marketPriceYuan">
              <el-input v-model="form.marketPriceYuan" placeholder="请输入市场价" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="意向价" prop="intentionPriceYuan">
              <el-input v-model="form.intentionPriceYuan" placeholder="请输入意向价" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="具体要求" prop="specificRequirement">
              <el-input v-model="form.specificRequirement" placeholder="请输入具体要求" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="推荐人" prop="recommender">
              <el-input v-model="form.recommender" placeholder="请输入推荐人" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="卧室" prop="bedroom">
              <el-input v-model="form.bedroom" placeholder="请输入卧室" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="客厅" prop="livingroom">
              <el-input v-model="form.livingroom" placeholder="请输入客厅" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="厕所" prop="toilet">
              <el-input v-model="form.toilet" placeholder="请输入厕所" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="厨房" prop="kitchen">
              <el-input v-model="form.kitchen" placeholder="请输入厨房" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="阳台" prop="balcony">
              <el-input v-model="form.balcony" placeholder="请输入阳台" />
            </el-form-item>
          </el-col>
        </el-row>

<!--        <el-form-item label="merchant" prop="merchant">-->
<!--          <el-input v-model="form.merchant" placeholder="请输入merchant" />-->
<!--        </el-form-item>-->

<!--        <el-form-item label="tagsstr" prop="tagsstr">-->
<!--          <el-input v-model="form.tagsstr" placeholder="请输入tagsstr" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="banner" prop="banner">-->
<!--          <el-input v-model="form.banner" placeholder="请输入banner" />-->
<!--        </el-form-item>-->
<!--        <el-form-item label="卧室" prop="deleteTime">-->
<!--          <el-date-picker clearable-->
<!--            v-model="form.deleteTime"-->
<!--            type="date"-->
<!--            value-format="yyyy-MM-dd"-->
<!--            placeholder="请选择卧室">-->
<!--          </el-date-picker>-->
<!--        </el-form-item>-->
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import {
    addDiscount_house,
    delDiscount_house,
    getDiscount_house,
    listDiscount_house,
    updateDiscount_house
  } from "@/api/yipaiju/discount_house";

  export default {
  name: "Discount_house",
  dicts: ['fo_discount_house_stage', 'fo_discount_house_status'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 折扣房源表格数据
      discount_houseList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        latitude: null,
        longitude: null,
        position: null,
        clientName: null,
        phone: null,
        registerTime: null,
        onlyHouse: null,
        owningType: null,
        degree: null,
        havingDegree: null,
        stage: null,
        discountRate: null,
        status: null,
        title: null,
        browseCount: null,
        priceYuan: null,
        builtUpAreaSquareCentimeter: null,
        uploadTime: null,
        residentialQuarterName: null,
        province: null,
        city: null,
        district: null,
        address: null,
        orientation: null,
        houseLevel: null,
        houseTotalLevel: null,
        elevator: null,
        decoration: null,
        traffic: null,
        education: null,
        hospital: null,
        amenity: null,
        location: null,
        unitNo: null,
        insideAreaSquareCentimeter: null,
        houseAge: null,
        houseUser: null,
        remainingLease: null,
        rentYuan: null,
        unitPriceYuan: null,
        viewingCall: null,
        mortgage1: null,
        mortgage2: null,
        mortgage1PriceYuan: null,
        mortgage2PriceYuan: null,
        seizure: null,
        confiscator1: null,
        confiscator2: null,
        seizureAmount1: null,
        seizureAmount2: null,
        estimatePriceYuan: null,
        marketPriceYuan: null,
        intentionPriceYuan: null,
        specificRequirement: null,
        recommender: null,
        bedroom: null,
        livingroom: null,
        toilet: null,
        kitchen: null,
        balcony: null,
        merchant: null,
        tagsstr: null,
        banner: null,
        deleteTime: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询折扣房源列表 */
    getList() {
      this.loading = true;
      listDiscount_house(this.queryParams).then(response => {
        this.discount_houseList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        latitude: null,
        longitude: null,
        position: null,
        clientName: null,
        phone: null,
        registerTime: null,
        onlyHouse: null,
        owningType: null,
        degree: null,
        havingDegree: null,
        stage: null,
        discountRate: null,
        status: null,
        title: null,
        browseCount: null,
        priceYuan: null,
        builtUpAreaSquareCentimeter: null,
        uploadTime: null,
        residentialQuarterName: null,
        province: null,
        city: null,
        district: null,
        address: null,
        orientation: null,
        houseLevel: null,
        houseTotalLevel: null,
        elevator: null,
        decoration: null,
        traffic: null,
        education: null,
        hospital: null,
        amenity: null,
        location: null,
        unitNo: null,
        insideAreaSquareCentimeter: null,
        houseAge: null,
        houseUser: null,
        remainingLease: null,
        rentYuan: null,
        unitPriceYuan: null,
        viewingCall: null,
        mortgage1: null,
        mortgage2: null,
        mortgage1PriceYuan: null,
        mortgage2PriceYuan: null,
        seizure: null,
        confiscator1: null,
        confiscator2: null,
        seizureAmount1: null,
        seizureAmount2: null,
        estimatePriceYuan: null,
        marketPriceYuan: null,
        intentionPriceYuan: null,
        specificRequirement: null,
        recommender: null,
        bedroom: null,
        livingroom: null,
        toilet: null,
        kitchen: null,
        balcony: null,
        merchant: null,
        updateTime: null,
        tagsstr: null,
        banner: null,
        deleteTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加折扣房源";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getDiscount_house(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改折扣房源";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateDiscount_house(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addDiscount_house(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除折扣房源编号为"' + ids + '"的数据项？').then(function() {
        return delDiscount_house(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('yipaiju/discount_house/export', {
        ...this.queryParams
      }, `discount_house_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
